<template>
  <div class="resume g-wrap">
    <mt-header fixed title="预答辩信息">
      <router-link to="/" slot="left">
        <mt-button icon="back">返回</mt-button>
      </router-link>
    </mt-header>
    <div v-if="!!infoData">
      <mt-cell title="学号" :value="infoData.xh || '--'"></mt-cell>
      <mt-cell title="姓名" :value="infoData.xm || '--'"></mt-cell>
      <mt-cell title="院系" :value="infoData.dwmc || '--'"></mt-cell>
      <mt-cell title="专业" :value="infoData.zymc || '--'"></mt-cell>
      <mt-cell title="研究方向" :value="infoData.yjfx || '--'"></mt-cell>
      <mt-cell title="学生类别" :value="infoData.xslbmc || '--'"></mt-cell>
      <mt-cell title="入学年月">
        <span>{{ infoData.rxny && this.$moment(infoData.rxny).format('YYYY-MM-DD') }}</span>
      </mt-cell>
      <mt-cell title="导师姓名" :value="infoData.dsxm || '--'"></mt-cell>
      <mt-cell title="平均绩点">{{ infoData.pjjd }}</mt-cell>
      <mt-cell title="课程学习情况">已修{{ infoData.yxxf || 0.0 }}学分</mt-cell>
      <mt-cell title="有无重修课程">{{ infoData.ywcxkc }}</mt-cell>
      <mt-cell title="拟定论文题目">{{ infoData.ndlwtm }}</mt-cell>
      <mt-cell title="题目来源">{{ infoData.tmly }}</mt-cell>
      <mt-cell title="是否不宜公开">{{ infoData.sfsmmc }}</mt-cell>
    </div>
    <div>
      <div v-if="!ydbInfoData && isLoading === 0" class="noData">未创建</div>
      <div v-if="ydbInfoData">
        <div class="itemBox">
          <div class="title">一、预期目标实现情况</div>
          <p v-html="(ydbInfoData.yqmbsxqk && ydbInfoData.yqmbsxqk.replace(/\n|\r\n/g, '<br/>')) || '--'"></p>
        </div>
        <div class="itemBox">
          <div class="title">二、论文的创新点</div>
          <p v-html="(ydbInfoData.lwcxd && ydbInfoData.lwcxd.replace(/\n|\r\n/g, '<br/>')) || '--'"></p>
        </div>
        <div class="itemBox">
          <div class="title">三、与国内（外）最新研究成果的比较</div>
          <p v-html="(ydbInfoData.zxcgbj && ydbInfoData.zxcgbj.replace(/\n|\r\n/g, '<br/>')) || '--'"></p>
        </div>
        <div class="itemBox">
          <div class="title">四、有何待解决的问题和更深一步研究的意义</div>
          <p v-html="(ydbInfoData.wtyyy && ydbInfoData.wtyyy.replace(/\n|\r\n/g, '<br/>')) || '--'"></p>
        </div>
      </div>

      <div v-if="ydbInfoData && ydbInfoData.ydbxxzt != '01'">
        <div class="mainTitle">预答辩专家对论文的基本评价</div>
        <div class="itemBox">
          <div class="title">论文格式规范与否</div>
          <p
            v-html="(ydbInfoData.zjzpjLwgsgfyfmc && ydbInfoData.zjzpjLwgsgfyfmc.replace(/\n|\r\n/g, '<br/>')) || '--'"
          ></p>
        </div>
        <div class="itemBox">
          <div class="title">文字与图表质量如何</div>
          <p
            v-html="(ydbInfoData.zjzpjWzhtbzlrhmc && ydbInfoData.zjzpjWzhtbzlrhmc.replace(/\n|\r\n/g, '<br/>')) || '--'"
          ></p>
        </div>
        <div class="itemBox">
          <div class="title">是否需要修改</div>
          <p v-html="(ydbInfoData.zjzpjSfxyxgmc && ydbInfoData.zjzpjSfxyxgmc.replace(/\n|\r\n/g, '<br/>')) || '--'"></p>
        </div>
        <div class="itemBox">
          <div class="title">是否延期申请学位</div>
          <p
            v-html="(ydbInfoData.zjzpjSfyqsqxwmc && ydbInfoData.zjzpjSfyqsqxwmc.replace(/\n|\r\n/g, '<br/>')) || '--'"
          ></p>
        </div>
        <div class="itemBox">
          <div class="title">专家组综合评价</div>
          <p v-html="(ydbInfoData.zjzzhpj && ydbInfoData.zjzzhpj.replace(/\n|\r\n/g, '<br/>')) || '--'"></p>
        </div>
        <div class="itemBox">
          <div class="title">论文研究水平达到</div>
          <p v-html="(ydbInfoData.lwyjspdjmc && ydbInfoData.lwyjspdjmc.replace(/\n|\r\n/g, '<br/>')) || '--'"></p>
        </div>
        <div class="itemBox">
          <div class="title">预答辩当前状态</div>
          <p v-html="(ydbInfoData.ydbxxztmc && ydbInfoData.ydbxxztmc.replace(/\n|\r\n/g, '<br/>')) || '--'"></p>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import request from '@/utils/request'
import { ydbInfo, ktbgInfo } from '@/api'
import { Indicator } from 'mint-ui'

export default {
  name: 'resume',
  data() {
    return {
      isLoading: 1,
      infoData: '',
      ydbInfoData: ''
    }
  },
  methods: {
    getStudentClientInfo() {
      Indicator.open()
      request
        .get(ktbgInfo, {})
        .then((res) => {
          Indicator.close()
          this.getStudentClientQkhxxInfo()
          const r = res.data
          if (r && r.data) {
            this.infoData = r.data || {}
          }
        })
        .catch((err) => {})
    },
    getStudentClientQkhxxInfo() {
      //Indicator.open()
      request
        .get(ydbInfo, {})
        .then((res) => {
          Indicator.close()
          const r = res.data
          this.isLoading = 0
          if (r && r.data) {
            this.ydbInfoData = r.data
          }
        })
        .catch((err) => {})
    }
  },
  mounted() {
    this.getStudentClientInfo()
    //this.getStudentClientQkhxxInfo()
  }
}
</script>

<style scoped lang="less">
@import url('../../../assets/styles/base.less');
.resume {
  .infoBox {
    margin-top: (20 / @base);
  }
  .link {
    margin-left: (30 / @base);
  }
  .infoTable {
    padding-bottom: (15 / @base);
    padding-right: (15 / @base);
    table {
      width: 100%;
    }
    th,
    td {
      font-size: (24 / @base);
      color: #666;
      font-weight: normal;
      width: 25%;
      text-align: center;
      border: 1px solid #d9d9d9;
    }
    th {
      color: #999;
    }
  }
  .noData {
    margin-top: (30 / @base);
    padding-bottom: (30 / @base);
  }
  .itemBox {
    .title {
      font-weight: 500;
      margin-bottom: (10 / @base);
    }
    padding: (20 / @base) (20 / @base);
    p {
      color: #888;
      font-weight: normal;
    }
  }
}
</style>
